New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CB-231: Use direct database access for entity: place #110
Conversation
Have you considered using mbdata package for this purpose? |
6f870b7
to
d6dca2d
Compare
@@ -0,0 +1,16 @@ | |||
import critiquebrainz.frontend.external.musicbrainz_db.exceptions as mb_exceptions | |||
|
|||
RELATABLE_TYPES = ['area', 'artist', 'label', 'place', 'event', 'recording', 'release', 'release-group', 'series', 'url', 'work', 'instrument'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This row is a bit too long. Can you split it like this?
RELATABLE_TYPES = [
'area',
...
'instrument',
]
THREAD_POOL_PROCESSES = 10 | ||
|
||
|
||
def get_place_by_id(id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to be more specific here and use mbid
instead of id
. I usually try to avoid using id
since it's a built in function.
Haven't been able to test this due to problems with the MusicBrainz database image setup. https://chatlogs.metabrainz.org/brainzbot/metabrainz/2017-06-26/?msg=3940782&page=2 |
9c5c988
to
e49ce44
Compare
e49ce44
to
500bddb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be working. Awesome!
Use direct database access for entity
place
. I have added functionsentity_relation_helper
andget_place_by_id
for fetching information regardingplace
.